package com.config;//package com.config;
//
//import at.pollux.thymeleaf.shiro.dialect.ShiroDialect;
//import com.realm.KillListRealm;
//import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
//import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import java.util.Hashtable;
//import java.util.Map;
//
//@Configuration
//public class ShiroConfig {
//
//
//
//
//
//    //shiro工厂管理权限，登录页面等等
//
//    @Bean
//    public ShiroFilterFactoryBean shiroFilterFactoryBean(@Qualifier("securityManager") DefaultWebSecurityManager securityManager){
//        ShiroFilterFactoryBean factoryBean = new ShiroFilterFactoryBean();
//        factoryBean.setSecurityManager(securityManager);
//        //权限设置
//        Map<String,String> map = new Hashtable<>();
//        map.put("/main","authc");
//        map.put("/manage","perms[manage]");
//        map.put("/administrator","roles[administrator]");
//        factoryBean.setFilterChainDefinitionMap(map);
//        //设置登录页面
////        factoryBean.setLoginUrl("/killNode/login");
//        //设置未授权页面
//        factoryBean.setUnauthorizedUrl("/killNode/unauth");
//        return factoryBean;
//    }
//
//    //SecurityManager管理我的realm
//    @Bean(name = "securityManager")
//    public DefaultWebSecurityManager securityManager(@Qualifier("killListRealm") KillListRealm killListRealm){
//        DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
//        securityManager.setRealm(killListRealm);
//        return securityManager;
//    }
//    //将我的realm交给工厂管理
//    @Bean
//    public KillListRealm killListRealm(){
//        return new KillListRealm();
//    }
//
//    //引入方言，让前端或者别的地方可以使用shiro相关语句
//    @Bean
//    public ShiroDialect shiroDialect(){
//        return new ShiroDialect();
//    }
//}
